<template>
  <el-table :data="tableData"
            stripe
            style="width: 100%">
    <el-table-column prop="tel"
                     label="预定手机号"
                     width="180">
    </el-table-column>
    <el-table-column prop="category"
                     label="预定类型"
                     width="180">
    </el-table-column>
    <el-table-column prop="time"
                     label="预定时间">
    </el-table-column>
    <el-table-column>
      <el-button @click="cancel" style=" width:100%; margin-bottom:0px;">取消预定</el-button>

    </el-table-column>
  </el-table>
</template>

<script>
  export default {
    data() {
      //在进入之前先从后台获取信息
      return {
        tableData: [{
          tel: '17312973192',
          category: '宴会大桌',
          time: '7:30'
        }, {
          tel: '41261432215',
          category: '大桌',
          time: '12:00'
        }, {
          tel: '13947283429',
          category: '中桌',
          time: '17:30'
        }, {
          tel: '17023462782',
          category: '小桌 ',
          time: '18:00'
        }]
      }
    },
    methods: {

      cancel() {
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            //发送删除信息给后端
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });

      }
    }
  }
</script>
